package com.allen.mk.admin.mapper;

import com.allen.mk.admin.entity.SysRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Allen
 * @since 2024-04-11
 */
@Mapper
public interface SysRoleMapper extends BaseMapper<SysRole> {

    @Select("select a.role_name from sys_role a,sys_user b,sys_user_role c where a.id = c.role_id and b.id = c.user_id and b.id = #{id}")
    List<SysRole> getAuthories(@Param("id") Integer id);


}
